int sys = system("cls");
bool is_win_os();
int build_git_folder(string path_name);  //建立.git文件夹
int init_target_folder(string path_name);  //用于在目标位置建立仓库
void hide_folder(string folder_name);  //隐藏文件夹
void build_store(string path);
int build_git_folder(string path_name)
{
    string command = "mkdir";
    command += " " + path_name;
    system(command.c_str());  
    if(is_win_os()) hide_folder(path_name);
    return 1;
}
int init_target_folder(string path_name)
{
    string command = "mkdir";
    command += " " + path_name;
    system(command.c_str());
    string s = is_win_os() ? "\\.git" : "/.git";
    if(!build_git_folder(path_name + s))
        cout << "初始化仓库失败，无法建立.git文件夹" << endl;
    else
    {
        if(is_win_os()) hide_folder(path_name + "\\.git");
        return 1;
    }
}
void hide_folder(string folder_name)
{
        string command = "attrib";
        command += " " + folder_name + " " + "+h";
        system(command.c_str());
}
bool is_win_os()
{
    #ifdef __WINDOWS_
        return true;
    #endif
    #ifdef _WIN32_
        return true;
    #endif
    #ifdef _WIN64_
        return true;
    #endif
    #ifdef linux
        return false;
    #endif
}
void build_store(string path)
{
    string s = is_win_os() ? "\\" : "/";
    path += s + ".git";
    string command = string("mkdir") + " " + path + s;
    system((command + "branches").c_str());
    system((command + "hooks").c_str());
    system((command + "info").c_str());
    system((command + "objects").c_str());
    system((command + "objects" + s + "info").c_str());
    system((command + "objects" + s + "pack").c_str());
    system((command + "refs").c_str());
    system((command + "refs" + s + "heads").c_str());
    system((command + "refs" + s + "tags").c_str());
}